package com.ruoyi.system.domain;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 智能床垫设备对象 device
 * 
 * @author ruoyi
 * @date 2025-10-28
 */
public class Device extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 设备唯一ID */
    private Long id;

    /** 设备序列号 */
    @Excel(name = "设备序列号")
    private String deviceSn;

    /** 设备型号 */
    @Excel(name = "设备型号")
    private String model;

    /** MAC地址 */
    @Excel(name = "MAC地址")
    private String macAddress;

    /** 固件版本 */
    @Excel(name = "固件版本")
    private String firmwareVersion;

    /** 关联用户ID */
    @Excel(name = "关联用户ID")
    private Long userId;

    /** 设备状态 (0:离线, 1:在线, 2:故障) */
    @Excel(name = "设备状态 (0:离线, 1:在线, 2:故障)")
    private Long status;

    /** 最后在线时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "最后在线时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date lastSeenAt;

    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }

    public void setDeviceSn(String deviceSn) 
    {
        this.deviceSn = deviceSn;
    }

    public String getDeviceSn() 
    {
        return deviceSn;
    }

    public void setModel(String model) 
    {
        this.model = model;
    }

    public String getModel() 
    {
        return model;
    }

    public void setMacAddress(String macAddress) 
    {
        this.macAddress = macAddress;
    }

    public String getMacAddress() 
    {
        return macAddress;
    }

    public void setFirmwareVersion(String firmwareVersion) 
    {
        this.firmwareVersion = firmwareVersion;
    }

    public String getFirmwareVersion() 
    {
        return firmwareVersion;
    }

    public void setUserId(Long userId) 
    {
        this.userId = userId;
    }

    public Long getUserId() 
    {
        return userId;
    }

    public void setStatus(Long status) 
    {
        this.status = status;
    }

    public Long getStatus() 
    {
        return status;
    }

    public void setLastSeenAt(Date lastSeenAt) 
    {
        this.lastSeenAt = lastSeenAt;
    }

    public Date getLastSeenAt() 
    {
        return lastSeenAt;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("deviceSn", getDeviceSn())
            .append("model", getModel())
            .append("macAddress", getMacAddress())
            .append("firmwareVersion", getFirmwareVersion())
            .append("userId", getUserId())
            .append("status", getStatus())
            .append("lastSeenAt", getLastSeenAt())
            .append("createTime", getCreateTime())
            .append("updateTime", getUpdateTime())
            .toString();
    }
}
